vcSimulation

Object type for simulation engine, thereby providing access to the scene graph and simulation controls.

See in: Overview

Module: vcCore

Parent: vcObject

Children -

Referenced by: vcCore.getSimulation()

Properties

Learn how to use properties here. The properties are also inherited from the parent class.

NameTypeAccessDescription
IsLoopingBooleanRWGets or sets if the simulation gets automatically restarted when finished.
IsRunningBooleanRGets a value indicating if simulation is running in 3D world.
RealTimeModeBooleanRWGets or sets if a simulation runs in real time or virtual time.
See more
A True value means the simulation runs at a speed indicative of the real world environment. A False value means the simulations runs at speed based on the device's CPU processing speed.
SimSpeedRealRWGets or sets the step size or speed of simulation.
SimTimeRealRGets the current simulation time in seconds.
SimWarmupTimeRealRWGets or sets a time in seconds of simulation warmup time.
SimulationRunTimeRealRWGets or sets a time in seconds when simulation should stop running.
Note: Changing the SimulationRunTime is only allowed in the OnRun event.

Methods

Learn how to use methods here. The methods are also inherited from the parent class.

NameReturn TypeParametersDescription
autoHaltBooleanNoneStops a simulation if there is no active component running a script that generates simulation events.

Returns:
bool: Status of the halt operation. True on success, otherwise False.
haltNoneNoneStops a simulation immediately.
resetNoneNoneResets simulation and static components to initial state and sets simulation clock at zero.
restoreInitialStateNoneNoneRestores simulation and static components to initial state.
setFastSchedulingNoneBoolean enabledUpdates the fast scheduling flag for all conveyors that support the property.

Parameters:
enabled (bool): Value to set.
setInitialStateNoneNoneSaves the current state of simulation and static components.

Exceptions:
RuntimeError: When no license for Simulation Settings API.
startNoneOptional Keyword[runtime = Real]Starts simulation to run for the specified duration.
See more
Parameters:
Optional: runtime (float): Simulation runtime in seconds. If not provided, simulation runs indefinitely.
updateNoneNoneUpdates simulation and 3D world to reflect current state of components.

Events

Learn how to use events here. The events are also inherited from the parent class.

NameParametersDescription
OnStateChangedvcSimulation simulation,
vcSimulationState state
Triggered when simulation state was changed.
Note: when simulation is reset, it will trigger this event 2 times,
See more
first with vcSimulationState.STOP and then vcSimulationState.RESET.

Parameters:
simulation (vcSimulation): Simulation object instance that was reset.
state (vcSimulationState): State of the simulation.